package com.aa;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
@Validated
public class TestController {

    @PostMapping("/test123")
    public String test(@RequestBody @Validated TestDemo demo){
        System.out.println(123);

        return "test";
    }

    @PostMapping("/test1")
    public String test1( String oldPwd, String newPwd){
        System.out.println(oldPwd+"***"+newPwd);

        return "test";
    }
}
